package org.example.iris.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.iris.entity.Student;

@Mapper
public interface StudentMapper {

    @Insert("insert into student(user_id) values(#{userId})")
    void insertStudent(Student student);

    @Select("select * from student where user_id = #{userId}")
    Student findByUserId(Integer userId);

    @Update("update student set real_name = #{realName}, gender = #{gender}, wechat_num = #{wechatNum}, birth = #{birth} " +
            "where user_id = #{userId}")
    void update(Student student);

    @Update("update student set profile_picture = #{url} where user_id = #{userId}")
    void updatePicture(String url, Integer userId);

    @Update("update student set job_status_selected = #{status} where user_id = #{userId}")
    void updateStatus(Integer userId, String status);

    @Update("update student set skill = #{skills} where user_id = #{userId}")
    void updateSkill(Integer userId, String skills);
}
